<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@page import="Dao.*"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<jsp:useBean id="StudentsInformationDao"
		class="Dao.StudentsInformationDao"></jsp:useBean>

	<%
			String status = session.getAttribute("session_status").toString();
	        String no =session.getAttribute("session_no").toString();
	        String newPwd = request.getParameter("newPwd");
			//oldPwd = StudentsInformationDao.queryStudentByNo(no).getPwd();
			if (status.equals("student")) {
				//oldPwd = StudentsInformationDao.queryStudentByNo(no).getPwd();
				if (StudentsInformationDao.alterPassword(no, newPwd) > 0) {
					out.print("<script type='text/javascript'>alert('修改成功')</script>");
					session.removeAttribute("session_status");
					session.removeAttribute("session_no");
				}
				System.out.print(status);
			}
		
			
		
	%>
</body>
</html>